#include <stdio.h>
#include <stdlib.h>

#define DEBUG
#include "common.h"
#include "utils.h"

static void trace(char * buf,int size)
{
		int i=0,j=0,k=0;\
		printf("________[%s/%s()/L%d/size:%d]________\n", __FILE__, __FUNCTION__, __LINE__,size);\
		for(i=0;i< (((size)%16 == 0)? (int)(size)/16:((int)(size)/16+1)) ;i++)\
		{\
			k=(i==((int)(size)/16))?(size%16):16;\
			for(j=0;j<k;j++){ printf("%02x ",(uint32)(buf)[16*i+j]&0xFF); }	\
			if( i==((int)size/16) ){ for(j=0;j<(16-(size)%16)*3;j++) printf(" ");}\
			printf(" ;  ");\
			for(j=0;j<k;j++)
			{ 
				printf("%c",(buf)[16*i+j]&0xFF);
				}		printf("\n");\
		}\
		printf("==========4=[buffer pri nt end]==12=============\n");\
}
			
int main(/*int args,char * argv[]*/)
{
	char hello[]={"vmware workstation ,software system v;semget()"};
	
	TRACE_HEX(hello,(int)sizeof(hello));
	printf("aaabbbbcccc \n");
	
	trace(hello,(sint32)sizeof(hello));
	
	return 0;
}
